
public class Seat {
	
	private long seatID;
	private FlightReservation reservation;
	private Passenger passenger;
	private FlightDate flightDate;
	
	private int seatCol;
	private int seatRow;
	
	public Seat(FlightDate flightDate, int seatRow, int seatCol) {
		
		this.flightDate = flightDate;
		this.seatCol = seatCol;
		this.seatRow = seatRow;
	}
	
	public Seat(Passenger passenger, FlightReservation reservation, 
			FlightDate flightDate, int seatRow, int seatCol) {
		
		this(flightDate, seatRow, seatCol);
		
		this.passenger = passenger;
		this.reservation = reservation;
	}

	/**
	 * @param seatID the seatID to set
	 */
	public void setSeatID(long seatID) {
		this.seatID = seatID;
	}

	/**
	 * @return the seatID
	 */
	public long getSeatID() {
		return seatID;
	}

	/**
	 * @param reservation the reservation to set
	 */
	public void setReservation(FlightReservation reservation) {
		this.reservation = reservation;
	}

	/**
	 * @return the reservation
	 */
	public FlightReservation getReservation() {
		return reservation;
	}

	/**
	 * @param passenger the passenger to set
	 */
	public void setPassenger(Passenger passenger) {
		this.passenger = passenger;
	}

	/**
	 * @return the passenger
	 */
	public Passenger getPassenger() {
		return passenger;
	}

	/**
	 * @param flightDate the flightDate to set
	 */
	public void setFlightDate(FlightDate flightDate) {
		this.flightDate = flightDate;
	}

	/**
	 * @return the flightDate
	 */
	public FlightDate getFlightDate() {
		return flightDate;
	}

	/**
	 * @param seatCol the seatCol to set
	 */
	public void setSeatCol(int seatCol) {
		this.seatCol = seatCol;
	}

	/**
	 * @return the seatCol
	 */
	public int getSeatCol() {
		return seatCol;
	}

	/**
	 * @param seatRow the seatRow to set
	 */
	public void setSeatRow(int seatRow) {
		this.seatRow = seatRow;
	}

	/**
	 * @return the seatRow
	 */
	public int getSeatRow() {
		return seatRow;
	}
	
	@Override
	public boolean equals(Object seat) {
		if (seat instanceof Seat) {
			Seat otherSeat = (Seat)seat;
			return ((seatRow == otherSeat.getSeatRow()) && (seatCol == otherSeat.getSeatCol()) && 
					(flightDate.getFlightDateID() == otherSeat.getFlightDate().getFlightDateID()));
		}
		return false;
	}
	
	 @Override
    public int hashCode() {
        return (int)(seatRow ^ seatCol ^ flightDate.getFlightDateID());
    }
}

